/*
//              INTEL CORPORATION PROPRIETARY INFORMATION
//  This software is supplied under the terms of a license  agreement or
//  nondisclosure agreement with Intel Corporation and may not be copied
//  or disclosed except in  accordance  with the terms of that agreement.
//    Copyright (c) 2006-2007 Intel Corporation. All Rights Reserved.
//
*/
#include "umc_defs.h"
#if defined (UMC_ENABLE_DVHD_VIDEO_DECODER)

#include "umc_dv100_decoder.h"

#define SCALE(val) ( (Ipp16s) (8191.0 /((Ipp64f) val) + 0.5))

namespace UMC
{

const Ipp16s DV100VideoDecoder :: LumaQuantizeMatrix_1080System[64] =
{
    128,  16,  17,  18,  18,  19,  42,  44,
     16,  17,  18,  18,  19,  38,  43,  45,
     17,  18,  19,  19,  40,  41,  45,  48,
     18,  18,  19,  40,  41,  42,  46,  49,
     18,  19,  40,  41,  42,  43,  48, 101,
     19,  38,  41,  42,  43,  44,  98, 104,
     42,  43,  45,  46,  48,  98, 109, 116,
     44,  45,  48,  49, 101, 104, 116, 123
};

const Ipp16s DV100VideoDecoder :: ChromaQuantizeMatrix_1080System[64]=
{

    128,  16,  17,  25,  26,  26,  42,  44,
     16,  17,  25,  25,  26,  38,  43,  91,
     17,  25,  26,  27,  40,  41,  91,  96,
     25,  25,  27,  40,  41,  84,  93, 197,
     26,  26,  40,  41,  84,  86, 191, 203,
     26,  38,  41,  84,  86, 177, 197, 209,
     42,  43,  91,  93, 191, 197, 219, 232,
     44,  91,  96, 197, 203, 209, 232, 246
};

const Ipp16s DV100VideoDecoder :: LumaQuantizeMatrix_720System[64]=
{
    128,  16,  17,  18,  18,  19,  42,  44,
     16,  17,  18,  18,  19,  38,  43,  68,
     17,  18,  19,  19,  40,  41,  68,  96,
     18,  18,  19,  40,  41,  63,  92,  98,
     18,  19,  40,  41,  63,  86,  96, 202,
     19,  38,  41,  63,  86,  88, 196, 208,
     42,  43,  68,  92,  96, 196, 218, 232,
     44,  68,  96,  98, 202, 208, 232, 246
};

const Ipp16s DV100VideoDecoder :: ChromaQuantizeMatrix_720System[64] =
{
    128,  24,  26,  36,  36,  38,  84,  88,
     24,  26,  36,  36,  38,  76,  86, 182,
     26,  36,  38,  38,  80,  82, 182, 192,
     36,  36,  38,  80,  82, 168, 186, 394,
     36,  38,  80,  82, 168, 192, 382, 406,
     38,  76,  82, 168, 172, 354, 394, 418,
     84,  86, 182, 186, 382, 394, 438, 464,
     88, 182, 192, 394, 406, 418, 464, 492
};

//const Ipp16s DV100VideoDecoder :: LumaQuantizeMatrix_1080System[64] =
//{
//    2048/*SCALE(128)*/,  SCALE(16),  SCALE(17),  SCALE(18),  SCALE(18),  SCALE(19),  SCALE(42),  SCALE(44),
//     SCALE(16),  SCALE(17),  SCALE(18),  SCALE(18),  SCALE(19),  SCALE(38),  SCALE(43),  SCALE(45),
//     SCALE(17),  SCALE(18),  SCALE(19),  SCALE(19),  SCALE(40),  SCALE(41),  SCALE(45),  SCALE(48),
//     SCALE(18),  SCALE(18),  SCALE(19),  SCALE(40),  SCALE(41),  SCALE(42),  SCALE(46),  SCALE(49),
//     SCALE(18),  SCALE(19),  SCALE(40),  SCALE(41),  SCALE(42),  SCALE(43),  SCALE(48), SCALE(101),
//     SCALE(19),  SCALE(38),  SCALE(41),  SCALE(42),  SCALE(43),  SCALE(44),  SCALE(98), SCALE(104),
//     SCALE(42),  SCALE(43),  SCALE(45),  SCALE(46),  SCALE(48),  SCALE(98), SCALE(109), SCALE(116),
//     SCALE(44),  SCALE(45),  SCALE(48),  SCALE(49), SCALE(101), SCALE(104), SCALE(116), SCALE(123)
//};
//
//const Ipp16s DV100VideoDecoder :: ChromaQuantizeMatrix_1080System[64]=
//{
//
//    2048/*SCALE(128)*/,  SCALE(16),  SCALE(17),  SCALE(25),  SCALE(26),  SCALE(26),  SCALE(42),  SCALE(44),
//     SCALE(16),  SCALE(17),  SCALE(25),  SCALE(25),  SCALE(26),  SCALE(38),  SCALE(43),  SCALE(91),
//     SCALE(17),  SCALE(25),  SCALE(26),  SCALE(27),  SCALE(40),  SCALE(41),  SCALE(91),  SCALE(96),
//     SCALE(25),  SCALE(25),  SCALE(27),  SCALE(40),  SCALE(41),  SCALE(84),  SCALE(93), SCALE(197),
//     SCALE(26),  SCALE(26),  SCALE(40),  SCALE(41),  SCALE(84),  SCALE(86), SCALE(191), SCALE(203),
//     SCALE(26),  SCALE(38),  SCALE(41),  SCALE(84),  SCALE(86), SCALE(177), SCALE(197), SCALE(209),
//     SCALE(42),  SCALE(43),  SCALE(91),  SCALE(93), SCALE(191), SCALE(197), SCALE(219), SCALE(232),
//     SCALE(44),  SCALE(91),  SCALE(96), SCALE(197), SCALE(203), SCALE(209), SCALE(232), SCALE(246)
//};
//
//const Ipp16s DV100VideoDecoder :: LumaQuantizeMatrix_720System[64]=
//{
//    2048/*SCALE(128)*/,  SCALE(16),  SCALE(17),  SCALE(18),  SCALE(18),  SCALE(19),  SCALE(42),  SCALE(44),
//     SCALE(16),  SCALE(17),  SCALE(18),  SCALE(18),  SCALE(19),  SCALE(38),  SCALE(43),  SCALE(68),
//     SCALE(17),  SCALE(18),  SCALE(19),  SCALE(19),  SCALE(40),  SCALE(41),  SCALE(68),  SCALE(96),
//     SCALE(18),  SCALE(18),  SCALE(19),  SCALE(40),  SCALE(41),  SCALE(63),  SCALE(92),  SCALE(98),
//     SCALE(18),  SCALE(19),  SCALE(40),  SCALE(41),  SCALE(63),  SCALE(86),  SCALE(96), SCALE(202),
//     SCALE(19),  SCALE(38),  SCALE(41),  SCALE(63),  SCALE(86),  SCALE(88), SCALE(196), SCALE(208),
//     SCALE(42),  SCALE(43),  SCALE(68),  SCALE(92),  SCALE(96), SCALE(196), SCALE(218), SCALE(232),
//     SCALE(44),  SCALE(68),  SCALE(96),  SCALE(98), SCALE(202), SCALE(208), SCALE(232), SCALE(246)
//};
//
//const Ipp16s DV100VideoDecoder :: ChromaQuantizeMatrix_720System[64] =
//{
//    2048/*SCALE(128)*/,  SCALE(24),  SCALE(26),  SCALE(36),  SCALE(36),  SCALE(38),  SCALE(84),  SCALE(88),
//     SCALE(24),  SCALE(26),  SCALE(36),  SCALE(36),  SCALE(38),  SCALE(76),  SCALE(86), SCALE(182),
//     SCALE(26),  SCALE(36),  SCALE(38),  SCALE(38),  SCALE(80),  SCALE(82), SCALE(182), SCALE(192),
//     SCALE(36),  SCALE(36),  SCALE(38),  SCALE(80),  SCALE(82), SCALE(168), SCALE(186), SCALE(394),
//     SCALE(36),  SCALE(38),  SCALE(80),  SCALE(82), SCALE(168), SCALE(192), SCALE(382), SCALE(406),
//     SCALE(38),  SCALE(76),  SCALE(82), SCALE(168), SCALE(172), SCALE(354), SCALE(394), SCALE(418),
//     SCALE(84),  SCALE(86), SCALE(182), SCALE(186), SCALE(382), SCALE(394), SCALE(438), SCALE(464),
//     SCALE(88), SCALE(182), SCALE(192), SCALE(394), SCALE(406), SCALE(418), SCALE(464), SCALE(492)
//};


const Ipp32s DV100VideoDecoder :: QuantizationSteps[] =
{
     //Class Number
     //0     1     2     3   //Quantization Number (QNO)
       0,    0,    0,    0,  //  0
       1,    2,    4,    8,  //  1
       2,    4,    8,    0,  //  2
       3,    6,   12,    0,  //  3
       4,    8,    0,    0,  //  4
       5,   10,    0,    0,  //  5
       6,   12,    0,    0,  //  6
       7,   14,    0,    0,  //  7
       8,    0,    0,    0,  //  8
      16,   32,   64,    0,  //  9
      18,   36,   72,    0,  // 10
      20,   40,   80,    0,  // 11
      22,   44,   88,    0,  // 12
      24,   48,   96,    0,  // 13
      28,   56,  112,    0,  // 14
      52,  104,    0,    0   // 15
};


} //namespace UMC

#endif //(UMC_ENABLE_DVHD_VIDEO_DECODER)
